<template>
  <div>
    <!--    <fullscreenModal :modal="fullscreenModal" defaultBgColor="#eee" :isAdd="false" label="楼宇" :isShowEdit="true"   @handleEdit="handleEdit" editType="detail"  @handleClose="fullscreenModal = false">-->
    <div class="detailCon">
      <div class="basicBox">
        <div class="top">
          <div class="tit">
            <b>
              {{ dataInfo.PINM }}
            </b>
          </div>
          <div class="row">
            <b>
              {{ dataInfo.SWID }}
            </b>
          </div>
        </div>
        <div class="middle">
          <p>
            <label>设备型号：</label>
            <span>{{ dataInfo.XINGH }}</span>
          </p>
          <p>
            <label>单位：</label>
            <span>{{ dataInfo.UNIT }}</span>
          </p>
          <p>
            <label>单价：</label>
            <span>{{ dataInfo.DANJ }}(元)</span>
          </p>
          <p>
            <label>物资大类：</label>
            <span>{{ dataInfo.WZDL }}</span>
          </p>
          <p>
            <label>物资小类：</label>
            <span>{{ dataInfo.WZXL }}</span>
          </p>
          <p>
            <label>楼宇信息：</label>
            <span>{{ dataInfo.FANGCNAME }}</span>
          </p>
          <p>
            <label>楼层信息：</label>
            <span>{{ dataInfo.LOUCNAME }}</span>
          </p>
          <p>
            <label>房间信息：</label>
            <span>{{ dataInfo.FANGJNAME }}</span>
          </p>
          <p>
            <label>供应商：</label>
            <span>{{ dataInfo.GYSMC }}</span>
          </p>
          <p>
            <label>生产厂家：</label>
            <span>{{ dataInfo.SHENGCCJ }}</span>
          </p>
          <p>
            <label>生产日期：</label>
            <span>{{ dataInfo.SHENGCSJ }}</span>
          </p>
          <p>
            <label>入库日期：</label>
            <span>{{ dataInfo.RUKSJ }}</span>
          </p>
          <p>
            <label>使用期限：</label>
            <span>{{ dataInfo.SHIYQX }}(月)</span>
          </p>
          <p>
            <label>保管人：</label>
            <span>{{ dataInfo.BAOGRNAME }}</span>
          </p>
          <p>
            <label>ERP编码：</label>
            <span>{{ dataInfo.ERPTAG }}</span>
          </p>
          <p>
            <label>状态：</label>
            <span>{{ dataInfo.STATUS }}</span>
          </p>
          <p>
            <label>备注：</label>
            <span>{{ dataInfo.REMARK }}</span>
          </p>

        </div>
        <div class="bottom">
        </div>
      </div>
    </div>

  </div>
</template>

<script>
import { getBangwzQuanxst, getLbByType, getLouyByUser } from '@api/srvAssurance/assetLabel/assetLabel'

export default {
  name: 'officeMaterialRegisterDetail',
  data () {
    return {
      fullscreenModal: false,
      dataInfo: {},
      data: {
        defaultData: {
          dlDataList: [], //大类数据
          xlDataList: [], //小类数据
          lyDataList: [], //楼宇数据
        },
        filterData: {
          dlDataList: [], //大类数据
          xlDataList: [], //小类数据
          lyDataList: [], //楼宇数据
        },
      },
    }
  },

  methods: {
    getSearch (id) {
      this.initData(id)
      this.initLbType()
      this.initLyData()
    },
    async initData (id) {
      let resData = await getBangwzQuanxst({ id: id })
      this.dataInfo = {}
      if (resData.status === 0) {
        this.dataInfo = resData.data
      }
    },
    async initLbType () {
      let lbDatas = await getLbByType({ type: '1' })
      if (lbDatas.status == 0) {
        var dataList = lbDatas.data
        dataList.forEach((item) => {
          if (item.parentCode == '') {
            this.data.defaultData.dlDataList.push(item)
          } else {
            this.data.defaultData.xlDataList.push(item)
          }
        })
      }
    },
    async initLyData () {
      let queryParam = {}
      queryParam.corpid =
        sessionStorage.getItem('corpId')
      let louYuDatas = await getLouyByUser(queryParam)
      if (louYuDatas.status == 0) {
        var dataList = louYuDatas.data
        dataList.forEach((item) => {
          item.name = item.fangcname
          this.data.defaultData.lyDataList.push(item)
        })
      }
    },
  }
}

</script>

<style scoped lang="less">
.detailCon {
  padding: 12px;
  box-sizing: border-box;
}

.basicBox {
  padding: 15px 10px 10px;
  box-sizing: border-box;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  position: relative;

  .top {
    border-bottom: 1px dashed #aaa;
    padding: 0 5px 10px;
    margin-bottom: 12px;
    position: relative;
    line-height: 22px;

    .tit {
      b {
        font-size: 16px;

        span {
          font-size: 14px;
        }
      }

      .type {
        background: #f2a84e;
        font-size: 9px;
        color: #fff;
        margin-left: 8px;
        padding: 2px 3px;
        border-radius: 3px;
      }
    }

    .row {
      color: #999;
      font-size: 13px;
    }

    .qrcode {
      position: absolute;
      top: 0;
      right: 0;

      img {
        width: 35px;
        height: 35px;
        margin-right: 10px;
      }
    }
  }

  .middle {
    padding: 0 5px 10px;
    box-sizing: border-box;
    //border-bottom: 1px dashed #aaa;
  }

  p {
    display: flex;
    line-height: 28px;

    label {
      width: 75px;
      color: #999;
    }

    span {
      color: #333;
      flex: 1;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
  }

  .bottom {
    padding: 0 5px;
    box-sizing: border-box;
    margin-top: 10px;

    p span,
    p label {
      color: #999;
    }
  }
}
</style>
